#include "..\Shered\GlobalFunctions.h"
string boolToStr(bool b)
{
	if(b==true)return "TRUE";
	return "FALSE";
}


string USER_PERMISSION_LEVEL_TO_STRING(int i)
{
	switch(i){
	case NONE:
		return "NONE";
	case STUDENT:
		return "STUDENT";
	case LECTURER:
		return "LECTURER";
	case ADMINISTRATOR:
		return "ADMINISTRATOR";
	}
	return "NONE";
}
string USER_TYPE_TO_STRING(int i)
{
	switch(i){
	case TYPE_STUDENT:
		return "STUDENT";
	case TYPE_LECTURER:
		return "LECTURER";
	case TYPE_ADMINISTRATOR:
		return "ADMINISTRATOR";
	}
	return "NONE";
}

int USER_PERMISSION_TO_INT(string userType)
{
	if(userType=="STUDENT")return STUDENT;
	if(userType=="LECTURER")return LECTURER;
	if(userType=="ADMINISTRATOR")return ADMINISTRATOR;
	else return NONE;
}
int USER_TYPE_TO_INT(string userType)
{
	if(userType=="STUDENT")return TYPE_STUDENT;
	if(userType=="LECTURER")return TYPE_LECTURER;
	if(userType=="ADMINISTRATOR")return TYPE_ADMINISTRATOR;
	else return TYPE_NONE;
}



string intToString(int num)
{
	ostringstream os;
	os << num;
	return os.str();

}

int stringToInt(string numstr) 
{
	istringstream is(numstr);
	int i;
	is >> i;
	return i;
}
bool intBetween(int num,int min,int max)
{
	return ((num>min)&&(num<max));
}

int max(int a,int b)
{
	if (a>b)return a;
	return b;
}

